package com.lib76.socket.model;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;

import com.lib76.socket.IMessageInterceptor;
import com.lib76.socket.IStatusController;
import com.lib76.socket.SocketTypeEnum;

/**
 * Socket���Ӽ�������Ϣ����
 * @author �ź�
 * @version 0.0.1(2013-11-3)
 */
public class SocketInfo {
	
	protected String id;
	protected String remoteIp;
	protected Integer remotePort;
	protected Integer localPort;
	protected SocketTypeEnum type;
	protected String messageProtocolVersion;
	protected String messageProtocolType;
	protected String statusControlClass;
	protected String messageControlClass;
	protected String interceptorPath;
	
	private List<String> interceptorClasses;
	
	protected IStatusController statusHandler;
	protected List<IMessageInterceptor> interceptors;
	
	public SocketInfo(){
		this.interceptorClasses = new ArrayList<String>();
		this.interceptors = new ArrayList<IMessageInterceptor>();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMessageProtocolVersion() {
		return messageProtocolVersion;
	}

	public void setMessageProtocolVersion(String messageProtocolVersion) {
		this.messageProtocolVersion = messageProtocolVersion;
	}

	public String getStatusControlClass() {
		return statusControlClass;
	}

	public void setStatusControlClass(String statusControlClass) {
		this.statusControlClass = statusControlClass;
	}

	public String getMessageControlClass() {
		return messageControlClass;
	}

	public void setMessageControlClass(String messageControlClass) {
		this.messageControlClass = messageControlClass;
	}

	public String getInterceptorPath() {
		return interceptorPath;
	}

	public void setInterceptorPath(String interceptorPath) {
		this.interceptorPath = interceptorPath;
	}

	public List<IMessageInterceptor> getInterceptors() {
		return interceptors;
	}

	public void setInterceptors(List<IMessageInterceptor> interceptors) {
		this.interceptors = interceptors;
	}

	public IStatusController getStatusHandler() {
		return statusHandler;
	}

	public void setStatusHandler(IStatusController statusHandler) {
		this.statusHandler = statusHandler;
	}
	
	public SocketTypeEnum getType() {
		return type;
	}

	public void setType(SocketTypeEnum type) {
		this.type = type;
	}

	public String getRemoteIp() {
		return remoteIp;
	}

	public void setRemoteIp(String remoteIp) {
		this.remoteIp = remoteIp;
	}

	public Integer getRemotePort() {
		return remotePort;
	}

	public void setRemotePort(Integer remotePort) {
		this.remotePort = remotePort;
	}

	public Integer getLocalPort() {
		return localPort;
	}

	public void setLocalPort(Integer localPort) {
		this.localPort = localPort;
	}

	public InetSocketAddress getLocalSocketAddress(){
		return new InetSocketAddress(localPort);
	}
	
	public InetSocketAddress getRemoteSocketAddress(){
		return new InetSocketAddress(remoteIp,remotePort);
	}
	
	public String getMessageProtocolType() {
		return messageProtocolType;
	}

	public void setMessageProtocolType(String messageProtocolType) {
		this.messageProtocolType = messageProtocolType;
	}

	public List<String> getInterceptorClasses() {
		return interceptorClasses;
	}

	public void setInterceptorClasses(List<String> interceptorClasses) {
		this.interceptorClasses = interceptorClasses;
	}
}
